Systems and methods for non-destructive editing of digital images

ABSTRACT

In one embodiment, a method includes receiving at least one transformation identifier associated with a first image maintained by a social-networking system. The transformation identifier includes at least one transformation version. The method further includes determining at least one transformation version. The method further includes determining at least one transformation for application to the first image based on the at least one transformation identifier and the at least one transformation version.

PRIORITY

This application is a continuation under 35 U.S.C. §120 of U.S. patentapplication Ser. No. 13/587,837, filed 16 Aug. 2012.

FIELD OF THE INVENTION

The present invention relates to the field of social networking. Moreparticularly, the present invention provides a technique for managingtransformations applied to an image submitted by a user of a socialnetworking system.

BACKGROUND

Internet social networks have become a significant phenomenon. Socialnetworks allow an internet user to create an account and a user profile,often for free, and interact with other users of the social network. Asocial network user can gain access to the profile of another user byrequesting to add him or her as a friend. Once approved, the“friendship” typically gives both users access to each other's profilesand the content posted on them. Friends' posts may appear as newsstories in each other's news feeds, and friends can usually comment oneach other's news stories. Social network users typically seek toassemble a group of friends or followers with whom they interact.Information on a user's profile is often only accessible to the user'sfriends.

Social networks are providing users with increasingly sophisticatedfunctionality. Early social networks offered little more than a simpleinterface for users to communicate and post messages. Now, on manysocial networks, users may share numerous different types of content andinteract with each other's content in a variety of ways. Content sharedon a social network may include digital media such as images. Users mayassemble albums that include photographs and other content and sharetheir albums with their friends. This functionality may include theability to edit media uploaded to a social network. Users may applycertain photo editing techniques and transformations that are providedas part of a suite of graphics editing tools within a social networkinguser interface. Because of their collaborative nature, social networkshave now become a popular means by which many people share photos andother media content.

SUMMARY

To allow for non-destructive editing of images within a socialnetworking system, embodiments of the invention include systems,methods, and computer readable media to facilitate applying, to animage, transformations selected on a user device. At least onetransformation identifier associated with a first image maintained by asocial networking system is received, wherein the at least onetransformation identifier includes at least one transformation version.At least one transformation for application to the first image isdetermined based on the at least one transformation identifier and theat least one transformation version.

In an embodiment, a request for an altered image may be received from aconsuming client. Capabilities of the consuming client may bedetermined, and a first image copy may be created based on the firstimage and the capabilities. In an embodiment, the consuming client maybe at least one of a smart consuming client and a simple consumingclient. The at least one transformation may be applied to the firstimage copy to create an altered image copy, and the altered image copymay be provided to a consuming client. Alternatively, the first imagecopy and an indication of the at least one transformation may beprovided to a consuming client.

In an embodiment, at least one transformation version may be determinedbased on the at least one transformation and the capabilities. Analtered image copy may be created by applying the at least onetransformation version to the first image copy. The altered image copymay be provided to the consuming client. Alternatively, the first imagecopy and the at least one transformation version may be provided to theconsuming client.

In an embodiment, a consuming client identifier may be received, and thecapabilities of the consuming client may be determined based on theconsuming client identifier. The at least one transformation may bedetermined based on the capabilities. In an embodiment, a publishingclient identifier may be received, and the at least one transformationmay be determined based on the publishing client identifier.

In an embodiment, the at least one transformation identifier may includea character string, which may be parsed by the social networking system.The at least one transformation identifier may be expressed in a humanreadable language. The at least one transformation identifier may beprovided by a first user of the social networking system to a seconduser of the social networking system.

In an embodiment, the at least one transformation identifier may bemapped to a hash based on a hash function. The at least onetransformation identifier may include a random number seed to be used inthe at least one transformation.

In an embodiment, the at least one transformation identifier may be usedto apply the at least one transformation to a second image. The firstimage may be associated with a first user of the social networkingsystem and the second image may be associated with a second user of thesocial networking system.

Many other features and embodiments of the invention will be apparentfrom the accompanying drawings and from the following detaileddescription.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts a system for facilitating the editing of digital imageswithin a social network in accordance with an embodiment of theinvention.

FIG. 2A illustrates a user of a social networking system copying to hiscomputer an image captured using his digital camera in accordance withan embodiment of the invention.

FIG. 2B illustrates the user accessing a user interface to upload theimage to the social networking system in accordance with an embodimentof the invention.

FIG. 2C illustrates the image uploaded to the social networking systemand displayed within a user interface in accordance with an embodimentof the invention.

FIG. 2D illustrates the user applying a number of transformations to theimage, resulting in an altered image in accordance with an embodiment ofthe invention.

FIG. 3 illustrates an example environment within which some embodimentsof the invention may be implemented in accordance with an embodiment ofthe invention.

FIG. 4 illustrates a process for applying transformations to an originalimage in accordance with an embodiment of the invention.

FIG. 5 illustrates a process for applying transformations to an originalimage using transformation identifiers and client identifiers inaccordance with an embodiment of the invention.

FIG. 6 illustrates a process for mapping transformations to a hash inaccordance with an embodiment of the invention.

FIG. 7 illustrates an example of a computer system that may be used toimplement one or more of the embodiments described herein.

The figures depict various embodiments of the present invention forpurposes of illustration only, wherein the figures use like referencenumerals to identify like elements. One skilled in the art will readilyrecognize from the following discussion that alternative embodiments ofthe structures and methods illustrated in the figures may be employedwithout departing from the principles of the invention described herein.

DETAILED DESCRIPTION Social Networking System General Introduction

FIG. 1 is a network diagram of a system 100 for facilitating the editingof digital images within a social network in accordance with anembodiment of the invention. The system 100 includes one or more userdevices 110, one or more external systems 120, the social networkingsystem 130, and a network 150. For purposes of illustration, theembodiment of the system 100, shown by FIG. 1, includes a singleexternal system 120 and a single user device 110. However, in otherembodiments, the system 100 may include more user devices 110 and/ormore external systems 120. In certain embodiments, the social networkingsystem 130 is operated by a social network provider, whereas theexternal systems 120 are separate from the social networking system 130in that they may be operated by different entities. In variousembodiments, however, the social networking system 130 and the externalsystems 120 operate in conjunction to provide social networking servicesto users (or members) of the social networking system 130. In thissense, the social networking system 130 provides a platform or backbone,which other systems, such as external systems 120, may use to providesocial networking services and functionalities to users across theInternet.

The user device 110 comprises one or more computing devices that canreceive input from a user and transmit and receive data via the network150. In one embodiment, the user device 110 is a conventional computersystem executing, for example, a Microsoft Windows compatible operatingsystem (OS), Apple OS X, and/or a Linux distribution. In anotherembodiment, the user device 110 can be a device having computerfunctionality, such as a smartphone, a tablet, a personal digitalassistant (PDA), a mobile telephone, etc. The user device 110 isconfigured to communicate via the network 150. The user device 110 canexecute an application, for example, a browser application that allows auser of the user device 110 to interact with the social networkingsystem 130. In another embodiment, the user device 110 interacts withthe social networking system 130 through an application programminginterface (API) provided by the native operating system of the userdevice 110, such as iOS and ANDROID. The user device 110 is configuredto communicate with the external system 120 and the social networkingsystem 130 via the network 150, which may comprise any combination oflocal area and/or wide area networks, using wired and/or wirelesscommunication systems.

In one embodiment, the network 150 uses standard communicationstechnologies and protocols. Thus, the network 150 can include linksusing technologies such as Ethernet, 802.11, worldwide interoperabilityfor microwave access (WiMAX), 3G, 4G, CDMA, GSM, LTE, digital subscriberline (DSL), etc. Similarly, the networking protocols used on the network150 can include multiprotocol label switching (MPLS), transmissioncontrol protocol/Internet protocol (TCP/IP), User Datagram Protocol(UDP), hypertext transport protocol (HTTP), simple mail transferprotocol (SMTP), file transfer protocol (FTP), and the like. The dataexchanged over the network 150 can be represented using technologiesand/or formats including hypertext markup language (HTML) and extensiblemarkup language (XML). In addition, all or some links can be encryptedusing conventional encryption technologies such as secure sockets layer(SSL), transport layer security (TLS), and Internet Protocol security(IPsec).

In one embodiment, the user device 110 may display content from theexternal system 120 and/or from the social networking system 130 byprocessing a markup language document 114 received from the externalsystem 120 and from the social networking system 130 using a browserapplication 112. The markup language document 114 identifies content andone or more instructions describing formatting or presentation of thecontent. By executing the instructions included in the markup languagedocument 114, the browser application 112 displays the identifiedcontent using the format or presentation described by the markuplanguage document 114. For example, the markup language document 114includes instructions for generating and displaying a web page havingmultiple frames that include text and/or image data retrieved from theexternal system 120 and the social networking system 130. In variousembodiments, the markup language document 114 comprises a data fileincluding extensible markup language (XML) data, extensible hypertextmarkup language (XHTML) data, or other markup language data.Additionally, the markup language document 114 may include JAVASCRIPTOBJECT NOTATION (JSON) data, JSON with padding (JSONP), and JAVASCRIPTdata to facilitate data-interchange between the external system 120 andthe user device 110. The browser application 112 on the user device 110may use a JAVASCRIPT compiler to decode the markup language document114.

The markup language document 114 may also include, or link to,applications or application frameworks such as FLASH™ or Unity™applications, the SilverLight™ application framework, etc.

In one embodiment, the user device 110 also includes one or more cookies116 including data indicating whether a user of the user device 110 islogged into the social networking system 130, which may enablecustomization of the data communicated from the social networking system130 to the user device 110. In one embodiment, the user device 110 alsoincludes a news feed rendering module 118.

The external system 120 includes one or more web servers that includeone or more web pages 122 a, 122 b, which are communicated to the userdevice 110 using the network 150. The external system 120 is separatefrom the social networking system 130. For example, the external system120 is associated with a first domain, while the social networkingsystem 130 is associated with a separate social networking domain. Webpages 122 a, 122 b, included in the external system 120, comprise markuplanguage documents 114 identifying content and including instructionsspecifying formatting or presentation of the identified content.

The social networking system 130 includes one or more computing devicesfor a social network, including a plurality of users, and providingusers of the social network with the ability to communicate and interactwith other users of the social network. In some instances, the socialnetwork can be represented by a graph, i.e., a data structure includingedges and nodes. Other data structures can also be used to represent thesocial network, including but not limited to databases, objects,classes, meta elements, files, or any other data structure.

Users may join the social networking system 130 and then add connectionsto any number of other users of the social networking system 130 to whomthey desire to be connected. As used herein, the term “friend” refers toany other user of the social networking system 130 to whom a user hasformed a connection, association, or relationship via the socialnetworking system 130. For example, in an embodiment, if users in thesocial networking system 130 are represented as nodes in the socialgraph, the term “friend” can refer to an edge formed between anddirectly connecting two user nodes.

Connections may be added explicitly by a user or may be automaticallycreated by the social networking system 130 based on commoncharacteristics of the users (e.g., users who are alumni of the sameeducational institution). For example, a first user specifically selectsa particular other user to be a friend. Connections in the socialnetworking system 130 are usually in both directions, but need not be,so the terms “user” and “friend” depend on the frame of reference.Connections between users of the social networking system 130 areusually bilateral (“two-way”), or “mutual,” but connections may also beunilateral, or “one-way.” For example, if Bob and Joe are both users ofthe social networking system 130 and connected to each other, Bob andJoe are each other's connections. If, on the other hand, Bob wishes toconnect to Joe to view data communicated to the social networking system130 by Joe, but Joe does not wish to form a mutual connection, aunilateral connection may be established. The connection between usersmay be a direct connection; however, some embodiments of the socialnetworking system 130 allow the connection to be indirect via one ormore levels of connections or degrees of separation.

In addition to establishing and maintaining connections between usersand allowing interactions between users, the social networking system130 provides users with the ability to take actions on various types ofitems supported by the social networking system 130. These items mayinclude groups or networks (i.e., social networks of people, entities,and concepts) to which users of the social networking system 130 maybelong, events or calendar entries in which a user might be interested,computer-based applications that a user may use via the socialnetworking system 130, transactions that allow users to buy or sellitems via services provided by or through the social networking system130, and interactions with advertisements that a user may perform on oroff the social networking system 130. These are just a few examples ofthe items upon which a user may act on the social networking system 130,and many others are possible. A user may interact with anything that iscapable of being represented in the social networking system 130 or inthe external system 120, separate from the social networking system 130,or coupled to the social networking system 130 via the network 150.

The social networking system 130 is also capable of linking a variety ofentities. For example, the social networking system 130 enables users tointeract with each other as well as external systems 120 or otherentities through an API, a web service, or other communication channels.The social networking system 130 generates and maintains the “socialgraph” comprising a plurality of nodes interconnected by a plurality ofedges. Each node in the social graph may represent an entity that canact on another node and/or that can be acted on by another node. Thesocial graph may include various types of nodes. Examples of types ofnodes include users, non-person entities, content items, web pages,groups, activities, messages, concepts, and any other things that can berepresented by an object in the social networking system 130. An edgebetween two nodes in the social graph may represent a particular kind ofconnection, or association, between the two nodes, which may result fromnode relationships or from an action that was performed by one of thenodes on the other node. In some cases, the edges between nodes can beweighted. The weight of an edge can represent an attribute associatedwith the edge, such as a strength of the connection or associationbetween nodes. Different types of edges can be provided with differentweights. For example, an edge created when one user “likes” another usermay be given one weight, while an edge created when a user befriendsanother user may be given a different weight.

As an example, when a first user identifies a second user as a friend,an edge in the social graph is generated connecting a node representingthe first user and a second node representing the second user. Asvarious nodes relate or interact with each other, the social networkingsystem 130 modifies edges connecting the various nodes to reflect therelationships and interactions.

The social networking system 130 also includes user-generated content,which enhances a user's interactions with the social networking system130. User-generated content may include anything a user can add, upload,send, or “post” to the social networking system 130. For example, a usercommunicates posts to the social networking system 130 from a userdevice 110. Posts may include data such as status updates or othertextual data, location information, images such as photos, videos,links, music or other similar data and/or media. Content may also beadded to the social networking system 130 by a third-party. Content“items” are represented as objects in the social networking system 130.In this way, users of the social networking system 130 are encouraged tocommunicate with each other by posting text and content items of varioustypes of media through various communication channels. Suchcommunication increases the interaction of users with each other andincreases the frequency with which users interact with the socialnetworking system 130.

The social networking system 130 includes a web server 132, an APIrequest server 134, a user profile store 136, a connection store 138, anaction logger 140, an activity log 142, an authorization server 144, andan image processing module 146. In an embodiment of the invention, thesocial networking system 130 may include additional, fewer, or differentcomponents for various applications. Other components, such as networkinterfaces, security mechanisms, load balancers, failover servers,management and network operations consoles, and the like are not shownso as to not obscure the details of the system.

The user account store 136 maintains information about user accounts,including biographic, demographic, and other types of descriptiveinformation, such as work experience, educational history, hobbies orpreferences, location, and the like that has been declared by users orinferred by the social networking system 130. This information is storedin the user account store 136 such that each user is uniquelyidentified. The social networking system 130 also stores data describingone or more connections between different users in the connection store138. The connection information may indicate users who have similar orcommon work experience, group memberships, hobbies, or educationalhistory. Additionally, the social networking system 130 includesuser-defined connections between different users, allowing users tospecify their relationships with other users. For example, user-definedconnections allow users to generate relationships with other users thatparallel the users' real-life relationships, such as friends,co-workers, partners, and so forth. Users may select from predefinedtypes of connections, or define their own connection types as needed.Connections with other nodes in the social networking system 130, suchas non-person entities, buckets, cluster centers, images, interests,pages, external systems, concepts, and the like are also stored in theconnection store 138.

The social networking system 130 maintains data about objects with whicha user may interact. To maintain this data, the user account store 136and the connection store 138 store instances of the corresponding typeof objects maintained by the social networking system 130. Each objecttype has information fields that are suitable for storing informationappropriate to the type of object. For example, the user account store136 contains data structures with fields suitable for describing auser's account and information related to a user's account. When a newobject of a particular type is created, the social networking system 130initializes a new data structure of the corresponding type, assigns aunique object identifier to it, and begins to add data to the object asneeded. This might occur, for example, when a user becomes a user of thesocial networking system 130, the social networking system 130 generatesa new instance of a user profile in the user account store 136, assignsa unique identifier to the user account, and begins to populate thefields of the user account with information provided by the user.

The connection store 138 includes data structures suitable fordescribing a user's connections to other users, connections to externalsystems 120 or connections to other entities. The connection store 138may also associate a connection type with a user's connections, whichmay be used in conjunction with the user's privacy setting to regulateaccess to information about the user. In an embodiment of the invention,the user account store 136 and the connection store 138 may beimplemented as a federated database.

Data stored in the connection store 138, the user account store 136, andthe activity log 142 enables the social networking system 130 togenerate the social graph that uses nodes to identify various objectsand edges connecting nodes to identify relationships between differentobjects. For example, if a first user establishes a connection with asecond user in the social networking system 130, user accounts of thefirst user and the second user from the user account store 136 may actas nodes in the social graph. The connection between the first user andthe second user stored by the connection store 138 is an edge betweenthe nodes associated with the first user and the second user. Continuingthis example, the second user may then send the first user a messagewithin the social networking system 130. The action of sending themessage, which may be stored, is another edge between the two nodes inthe social graph representing the first user and the second user.Additionally, the message itself may be identified and included in thesocial graph as another node connected to the nodes representing thefirst user and the second user.

In another example, a first user may tag a second user in an image thatis maintained by the social networking system 130 (or, alternatively, inan image maintained by another system outside of the social networkingsystem 130). The image may itself be represented as a node in the socialnetworking system 130. This tagging action may create edges between thefirst user and the second user as well as create an edge between each ofthe users and the image, which is also a node in the social graph. Inyet another example, if a user confirms attending an event, the user andthe event are nodes obtained from the user account store 136, where theattendance of the event is an edge between the nodes that may beretrieved from the activity log 142. By generating and maintaining thesocial graph, the social networking system 130 includes data describingmany different types of objects and the interactions and connectionsamong those objects, providing a rich source of socially relevantinformation.

The web server 132 links the social networking system 130 to one or moreuser devices 110 and/or one or more external systems 120 via the network150. The web server 132 serves web pages, as well as other web-relatedcontent, such as JAVA, JAVASCRIPT, Flash, XML, and so forth. The webserver 132 may include a mail server or other messaging functionalityfor receiving and routing messages between the social networking system130 and one or more user devices 110. The messages can be instantmessages, queued messages (e.g., email), text and SMS messages, or anyother suitable messaging format.

The API request server 134 allows one or more external systems 120 anduser devices 110 to call access information from the social networkingsystem 130 by calling one or more API functions. The API request server134 may also allow external systems 120 to send information to thesocial networking system 130 by calling APIs. The external system 120,in one embodiment, sends an API request to the social networking system130 via the network 150, and the API request server 134 receives the APIrequest. The API request server 134 processes the request by calling anAPI associated with the API request to generate an appropriate response,which the API request server 134 communicates to the external system 120via the network 150. For example, responsive to an API request, the APIrequest server 134 collects data associated with a user, such as theuser's connections that have logged into the external system 120, andcommunicates the collected data to the external system 120. In anotherembodiment, the user device 110 communicates with the social networkingsystem 130 via APIs in the same manner as external systems 120.

The action logger 140 is capable of receiving communications from theweb server 132 about user actions on and/or off the social networkingsystem 130. The action logger 140 populates the activity log 142 withinformation about user actions, enabling the social networking system130 to discover various actions taken by its users within the socialnetworking system 130 and outside of the social networking system 130.Any action that a particular user takes with respect to another node onthe social networking system 130 may be associated with each user'saccount, through information maintained in the activity log 142 or in asimilar database or other data repository. Examples of actions taken bya user within the social networking system 130 that are identified andstored may include, for example, adding a connection to another user,sending a message to another user, reading a message from another user,viewing content associated with another user, attending an event postedby another user, posting an image, attempting to post an image, or otheractions interacting with another user or another object. When a usertakes an action within the social networking system 130, the action isrecorded in the activity log 142. In one embodiment, the socialnetworking system 130 maintains the activity log 142 as a database ofentries. When an action is taken within the social networking system130, an entry for the action is added to the activity log 142. Theactivity log 142 may be referred to as an action log.

Additionally, user actions may be associated with concepts and actionsthat occur within an entity outside of the social networking system 130,such as an external system 120 that is separate from the socialnetworking system 130. For example, the action logger 140 may receivedata describing a user's interaction with an external system 120 fromthe web server 132. In this example, the external system 120 reports auser's interaction according to structured actions and objects in thesocial graph.

Other examples of actions where a user interacts with an external system120 include a user expressing an interest in an external system 120 oranother entity, a user posting a comment to the social networking system130 that discusses an external system 120 or a web page 122 a within theexternal system 120, a user posting to the social networking system 130a Uniform Resource Locator (URL) or other identifier associated with anexternal system 120, a user attending an event associated with anexternal system 120, or any other action by a user that is related to anexternal system 120. Thus, the activity log 142 may include actionsdescribing interactions between a user of the social networking system130 and an external system 120 that is separate from the socialnetworking system 130.

The authorization server 144 enforces one or more privacy settings ofthe users of the social networking system 130. A privacy setting of auser determines how particular information associated with a user can beshared. The privacy setting comprises the specification of particularinformation associated with a user and the specification of the entityor entities with whom the information can be shared. Examples ofentities with which information can be shared may include other users,applications, external systems 120, or any entity that can potentiallyaccess the information. The information that can be shared by a usercomprises user account information, such as profile photos, phonenumbers associated with the user, user's connections, actions taken bythe user such as adding a connection, changing user profile information,and the like.

The privacy setting specification may be provided at different levels ofgranularity. For example, the privacy setting may identify specificinformation to be shared with other users; the privacy settingidentifies a work phone number or a specific set of related information,such as, personal information including profile photo, home phonenumber, and status. Alternatively, the privacy setting may apply to allthe information associated with the user. The specification of the setof entities that can access particular information can also be specifiedat various levels of granularity. Various sets of entities with whichinformation can be shared may include, for example, all friends of theuser, all friends of friends, all applications, or all external systems120. One embodiment allows the specification of the set of entities tocomprise an enumeration of entities. For example, the user may provide alist of external systems 120 that are allowed to access certaininformation. Another embodiment allows the specification to comprise aset of entities along with exceptions that are not allowed to access theinformation. For example, a user may allow all external systems 120 toaccess the user's work information, but specify a list of externalsystems 120 that are not allowed to access the work information. Certainembodiments call the list of exceptions that are not allowed to accesscertain information a “block list”. External systems 120 belonging to ablock list specified by a user are blocked from accessing theinformation specified in the privacy setting. Various combinations ofgranularity of specification of information, and granularity ofspecification of entities, with which information is shared arepossible. For example, all personal information may be shared withfriends whereas all work information may be shared with friends offriends.

The authorization server 144 contains logic to determine if certaininformation associated with a user can be accessed by a user's friends,external systems 120, and/or other applications and entities. Theexternal system 120 may need authorization from the authorization server144 to access the user's more private and sensitive information, such asthe user's work phone number. Based on the user's privacy settings, theauthorization server 144 determines if another user, the external system120, an application, or another entity is allowed to access informationassociated with the user, including information about actions taken bythe user.

The social networking system 130 may also include an image processingmodule 146. The image processing module 146 may receive images from theuser device 110, provide images to the user device 110, and apply any ofthe techniques for processing images described herein.

Non-Destructive Image Editing

Users may take advantage of the collaborative features and functionalityof the social networking system 130 to upload and share digital images.Users of the social networking system 130 may upload images for displayon their user profiles. For example, a user of the social networkingsystem 130 may upload a profile picture that features prominently on herprofile and identifies her to friends and other users. A user may alsoupload a cover image that may be displayed as a banner across the top ofthe user's profile. In addition to images for display on user profiles,users may also upload images for sharing with other users, such asphotographs of an event, artwork, professional photography portfolios,photographs from nature, or any other type of digital images.

A user of the social networking system 130 may wish to edit and modifyimages uploaded to the social networking system 130. Using a photoediting application, the user may modify the photo by applyingtransformations to the original image. Transformations may includediscrete operations such as cropping, blurring, filtering, rotating, orany other modification of the original image. A transformation maycomprise an operation (e.g., crop) and a set of parameters (e.g., arange of pixels to be included in the cropped image). According to oneembodiment of the invention, a transformation may comprise multipleoperations. For example, a transformation may produce an effect that isthe result of several discrete operations that are grouped as a singletransformation. According to another embodiment, some or alltransformations may comprise discrete operations.

Transformations may be applied to images stored within the socialnetworking system 130 in a number of ways. It may be possible todownload the image from the social networking system 130 to a userdevice 110, apply the transformations to the image using a photo editingtool on the user device 110, said tool being separate from the socialnetworking system 130, and re-upload the altered image back from theuser device 110 to the social networking system 130. However,downloading and uploading images in order to edit them may result ininefficient use of the resources of the social networking system 130,since both the original image and the altered image may be stored withinthe social networking system 130 even if the user no longer needs one ormore of the images. Moreover, use of compression techniques by thesocial networking system 130 in downloading the original image onto theuser device 110 or by the user device 110 in uploading the altered imageto the social networking system 130 may produce visible artifacts in theimages. To address these inefficiencies and quality concerns, the socialnetworking system 130 may provide users with functionality for editingimages within a user interface of the social networking system 130.Using this functionality, a user may edit an image as it resides withinthe social networking system 130 without having to download the originalimage to the user device 110, perform the edits on the user device 110,and re-upload the altered image. The various user devices 110 used toaccess images on the social networking system 130 may include publishingclients, e.g., devices that are used to upload original images andspecify certain transformations to be applied to the original images,and consuming clients, e.g., devices that are used to view copies ofaltered images. According to an embodiment, the functionality forediting images may be provided by the social networking system 130 or bya separate entity.

FIGS. 2A-2D illustrate photo editing functionality of the socialnetworking system 130 according to an embodiment of the invention. InFIG. 2A, user Brady Carr has captured an image 202 with the built-incamera of his mobile device 201. The mobile device 201 may be asmartphone, a tablet device, a laptop computer with a built-in camera,or other user device 110. Alternatively, the image 202 may be taken witha dedicated camera (not pictured) and transferred to a user device suchas a laptop computer or a desktop computer. In FIG. 2B, Brady Carr hasaccessed a user interface 204 to upload the image 202 to the socialnetworking system 130. Brady Carr selects an ‘upload’ option 205 withinthe user interface 204 that prompts him to browse to the location of theimage 202 on the local storage of his mobile device 201. He locates theimage 202, indicated by a thumbnail 203 and a filename ‘image.jpg’, andselects the ‘OK’ option 206. In FIG. 2C, the image 202 has been uploadedto the social networking system 130 and is displayed within the userinterface 204. The user interface 204 in FIG. 2C includes a photoediting utility 207 with an options toolbar 208 to allow a user toselect transformations to be applied to an image. In FIG. 2D, Brady Can,using the photo editing utility 207 and the options toolbar 208, hasapplied a number of transformations to the image 202, resulting in analtered image 209. These transformations include a 90 degree rotation,indicated by a ‘rotate’ button 210, a crop, indicated by a ‘crop’ button211, and a blur, indicated by a ‘blur’ button 212. Brady Carr mayfinalize and submit these transformations by selecting a save option213. The altered image 209 may be viewed by a user of the socialnetworking system 130 on a user device 110.

According to an embodiment, the user may select an option that applies ahigh-level effect to the image 202. The high-level effect may alter theimage to convey a particular impression or type of scene. The high-leveleffect may be implemented by combining several transformations. Forexample, an effect called ‘western’ may be implemented by applying atransformation that adds fake film grain and a transformation thatconverts the image 202 into a sepia-toned image. In an embodiment, thehigh-level effect may be identified by a single unique identifier, andthe user device may provide the unique identifier to the socialnetworking system 130 when the user selects the high-level effect andselects a save option. In an embodiment, the user may design his ownhigh-level effects by selecting multiple transformations and saving theselected transformations for application to other images. In anembodiment, the user may share the high-level effect he has designedwith other users. In an embodiment, the high-level effects may bespecified using text-based unique identifiers that may be entered in acommand-line interface.

Images may be viewed and edited using a client. A client may refer to adevice, an application, a portal, a photo editing tool, or any hardwareor software component used to access or otherwise handle an image.Clients may include publishing clients and consuming clients. Apublishing client may refer to a client used to select transformationsfor application to an image. In FIGS. 2A-2D, the mobile device 201 andthe photo editing utility 207 may be publishing clients. A consumingclient may refer to a client used to view an image. In FIGS. 2A-2D, anapplication or device used to view the altered image 209 may be aconsuming client. Consuming clients may include smart consuming clientsand simple consuming clients. A smart consuming client may refer to aconsuming client that receives transformations and an original imagecopy and applies the transformations to the original image copy. Asimple consuming client may refer to a consuming client that receives acopy of an altered image to which the transformations have already beenapplied by the social networking system 130.

According to an embodiment, a single user device 110 may function asboth a publishing client and a consuming client. For example, the userdevice may have a photo editing application with photo editingfunctionality and a photo viewing application with no photo editingfunctionality. The user device may function as a publishing client whenthe photo editing application accesses an image and as a consumingclient when the photo viewing application accesses the image. In anembodiment, a consuming client may function as both a simple consumingclient and a smart consuming client. For example, a user device 110 mayhave a battery level threshold below which it activates a power-savingmode. The power-saving mode may prevent the user device 110 fromapplying image transformations. Thus, when the battery level of the userdevice 110 is above the threshold for the power-saving mode, the userdevice 110 may function as a smart consuming client that appliestransformations to an original image copy. When the battery level of theuser device 110 falls below the threshold for the power-saving mode, theuser device 110 may function as a simple consuming client that receivesan altered image copy to which the transformations have already beenapplied.

FIG. 3 illustrates an example environment 300 within which someembodiments of the invention may be implemented. The environment 300 mayinclude a publishing client 301, a smart consuming client 302, a simpleconsuming client 303, an image storage module 304, and a pre-processingimage cache 305. The publishing client 301 may correspond to a userdevice 110 on which a user selects transformations to be applied to theoriginal image. The publishing client 301 provides a set oftransformations 306 (and, optionally, an original image 307) to theimage storage module 304 where the transformations are stored andassociated with the original image 307. The image storage module 304creates a copy 308 of the original image that may be optimized for thesmart consuming client 302. The smart consuming client 302 maycorrespond to a user device 110 that receives an original image copy 308and the selected transformations 306, and applies the selectedtransformations to the original image copy 308. The pre-processing imagecache 305 may receive the original image 307 and associatedtransformations 306 from the image storage module 304. Thepre-processing image cache 305 may create a copy 310 of the originalimage that is optimized for the simple consuming client 303 and applythe transformations to the original image copy 310. The pre-processingimage cache 305 may create a copy 310 of the original image 307 andapply the transformations 306 to the original image copy 310 either inresponse to a request for a particular altered image 309 from the simpleconsuming client 303 or at periodic intervals. The simple consumingclient 303, which may correspond to a user device 110, receives from thepre-processing image cache 305 a copy of the altered image 309 to whichthe selected transformations 306 have already been applied. According toan embodiment, the image processing module 146 of the social networkingsystem 130 may be implemented to include the image storage module 304and the pre-processing image cache 305.

The processes and techniques for applying transformations and viewingaltered images may be implemented in a number of ways. Editing the imagewithin a user interface of the social networking system 130 may resultin the image being downloaded and altered by the publishing client inresponse to the user requesting the image and selecting transformationsto be applied to it. This is because the publishing client may need todownload a copy of the image in order to display it to the user, and thetransformations selected by the user within the user interface may needto be applied in some form on the publishing client in order to show theuser what the altered image would look like. However, on the publishingclient, the user may be seeing a preview or copy of the image, not theoriginal image itself. The social networking system 130 may create acopy of the original image that is optimized for the publishing clientand provide the copy to the publishing client. The publishing client mayapply the transformations selected by the user to the original imagecopy. When the user finalizes his edits to the original image copy, thepublishing client may provide the transformations, not the entirealtered image copy, to the social networking system 130. This minimizesthe amount of data transmitted between the social networking system 130and the publishing client. Due to bandwidth and processing limitationsof user devices, particularly mobile devices, it may be desirable tolimit the amount of data transmitted between the publishing client andthe social networking system 130. Providing a list of transformations tothe social networking system 130 may require much less bandwidth andconsume fewer computing resources than providing an image.

According to an embodiment of the invention, all of the consumingclients may be smart consuming clients. In this embodiment, it may bepossible for the social networking system 130 to only store a copy of anoriginal image in a distributed cache storage. Every consuming clientmay retrieve the original image copy and apply transformations to theoriginal image copy. In an embodiment, the existence of simple consumingclients may require the social networking system 130 to apply atransformation and incur a computation cost to the system. However, thecomputational cost may be reasonable if simple consuming clients arerare. If simple consuming clients are common, then it may be preferablefor the social networking system 130 to cache the altered images. Thesocial networking system 130 may save computation costs, while incurringcache storage costs. In an embodiment, the social networking system 130may store both original image copies and altered image copies for acurrent user device landscape in which both smart consuming clients andsimple consuming clients are common, and gradually reduce storage spacedevoted to altered image copies in anticipation of smart consumingclients becoming predominant and simple consuming clients becomingobsolete.

According to one embodiment of the invention, each transformation may bedeclaratively expressed in a human readable language or format. Such alanguage or format may include a character or a set of characters thatincludes a unique identifier for the transformation along with itsoptional accompanying parameters. Some transformations may not beaccompanied by parameters, e.g., a blur may or may not allow the user tospecify the intensity or strength of the blur. For example, the croptransformation may be expressed by the letter ‘C’ and a parentheticalexpression indicating the pixel range for the crop, such as C(12, 42,24, 84) for a crop in which the top left corner of the cropped area isan image pixel with x coordinate 12 and y coordinate 42 and whose extentis 24 pixels wide and 84 pixels tall. According to one embodiment, eachtransformation may be expressed as an integer value. The transformationsselected by a user and the order in which the user selected them may beexpressed as a character string that includes the unique identifiers ofeach transformation and its optional accompanying parameters. Thecharacter string may be expressed according to, for example, a universalor predetermined convention or a code partially or exclusivelydetermined by the social networking system 130. According to oneembodiment, the character string may be provided to the socialnetworking system 130 upon the user selecting a ‘Save’ option within aphoto editing interface. The character string may be received by thesocial networking system 130 and applied to the original image.

According to an embodiment of the invention, the parameters of atransformation may be expressed in terms of specific pixels or pixelranges in the original image, as in the example above. According toanother embodiment, the parameters of a transformation may be expressedin terms of specific pixels or pixel ranges in the transformed image.For example, a resize transformation may be expressed as R(200, 400)wherein the parameters (200, 400) indicate that the original imageshould be resized such that the transformed image has dimensions200×400. In an embodiment, a publishing client or the social networkingsystem 130 may express absolute parameters specified by a user asrelative parameters. For example, if an original image has dimensions1000×2000, then a crop with absolute parameters C(100,200,200,400) maybe expressed as C′(10,10,20,20) wherein the parameters of C′ arerelative parameters based on the absolute parameters associated with C.In an embodiment, relative parameters may be translated into absoluteparameters by treating them as percentages of the original imagedimensions. Thus, C′(10,10,20,20)=C(10% of 1000, 10% of 2000, 20% of1000, 20% of 2000)=C(100,200,200,400).

According to an embodiment of the invention, relative parameters mayrefer to x coordinates and horizontal extents that are percentages ofthe original image width and y coordinates and vertical extents that arepercentages of the original image height. Resizing may be expressedsimilarly: R′(20,20)=R(20% of 1000, 20% of 2000)=R(200,400). Thepublishing client (and, upon delivery, any smart consuming client), asdescribed above, may apply transformations to a copy of the originalimage, and the copy may have smaller dimensions than the original. Thus,to apply the same transformations to the original image, the parametersassociated with the transformations may need to be adjusted to accountfor to the size of the original image. Such an adjustment may not beneeded if the transformation parameters are expressed as percentages.Expressing transformation parameters as percentages may also facilitatesharing of transformations and user-designed high-level effects forapplication to different images. Furthermore, although the above exampleis focused on coordinates and extents, relative parameters may have amore general nature. For example, a blur may also have anintensity/strength parameter, and the parameter may be expressed in away that makes the description of the blur transformation independent ofthe image size. To achieve the same visual result as a heavy blur on a1000×1000 image followed by resizing of the blurred image to dimensionsof 500×500, the original 1000×1000 may be resized to obtain a 500×500copy. A mild blur may be applied to the resized image. A heavy blur witha filter radius of 4 applied to a 1000×1000 image may become a mild blurwith a radius of 2 on a 500×500 image. Generally, intensity need not beexpressed as a radius, which is a pixel extent. Thus, “relative”transformation parameters may be more general than simple percentages.

Upon receiving the transformations, the social networking system 130 mayapply the transformations to the original image stored within the socialnetworking system 130 and replace the stored image with the alteredimage. Alternatively, the social networking system 130 may store thelist of transformations and associate it with the original image forlater application. The former approach, though intuitive, may have anumber of undesirable consequences. When transformations are applied toan original image and the altered image is stored in place of theoriginal image, it may be difficult or impossible to undo thetransformations if the user later wishes to retrieve the original image.The user may, for example, crop a person out of her profile picture whomshe later decides to ‘de-crop’ and re-add to the picture. This may beovercome by retaining a copy of the original image along with thealtered image. However, doing so may require extra disk space for eachinstance that the user edits an image and thereby consume an excessiveamount of storage within the social networking system 130. In addition,the user may wish to separately apply several sets of transformations tothe original image, resulting in multiple altered images created fromthe same original image and thus compounding the need for excessiveamounts of storage. In an embodiment, the user may specify privacysettings for images. For example, the user may elect to keep theoriginal image private and share images to which transformations havebeen applied with other users of the social networking system 130. Theuser may specify different privacy settings for different altered imagesbased on the same original image.

According to an embodiment of the invention, the original image andaltered images may have different privacy settings. For example, a usermay keep an original image of a fashion model private and publicize analtered, retouched image. In another example, a user may publicize anoriginal image of a landscape and offer an altered, artisticallyimproved image of the landscape only to friends in order to entice otherusers to “friend” him. In another example, a first user may publicize anoriginal image of a celebrity, a second user may transform the originalimage of a celebrity with a balloon annotation, and the first user mayset the original image of the celebrity to private while the second userkeeps the altered remains public.

In an embodiment, a smart consuming client may need to applytransformations to an original image to which the user of the smartconsuming client does not have access. This concern may be addressedwith authorized smart consuming clients that be trusted to preventaccess to the original copy when privacy settings demand so.Alternatively, the social networking system 130 may provide the alteredimage with an identify (no-op) transformation to an insecure smartconsuming client when the original's privacy settings would prohibitdelivery of the original image with the transformations.

If the social networking system 130 stores the transformations andassociates them with the original image rather than applying thetransformations and storing the altered image or images, the socialnetworking system 130 may apply the transformations to a copy of theoriginal image and provide the altered copy to a consuming client eachtime the image is requested. In this embodiment, the consuming client isa simple consuming client. Alternatively, the social networking system130 may create a copy of the original image and provide the originalimage copy and the transformations to the consuming client, allowing theconsuming client to apply the transformations to the original imagecopy. In this embodiment, the consuming client is a smart consumingclient. In either embodiment, storing the transformations andassociating them with the original image for later application allowsfor the transformations to be applied not to the original image, but toa copy of the image that is optimized for the consuming client fromwhich it is requested. The social networking system 130 may thus applythe transformations, or a subset of the transformations, in a mannerthat accounts for a device's capabilities and features. For example, ifthe consuming client requesting the altered image has a smaller displayand more limited graphics processing capabilities than the publishingclient, the social networking system 130 may create a copy of theoriginal image that is scaled down to fit within the display of theconsuming client. Thus, applying the transformations at the time thatthe image is requested may be a more efficient and versatile approach toprocessing user edits.

In addition, maintaining transformations separately from the images towhich they may be applied poses other advantages. For example, whenmaintained in a manner distinct from the original images to which theyare applied, the transformations can be readily applied to other images.The other images may be different in content from the original images orcopies thereof. As discussed in further detail below, certaintransformations may be used by or shared with other users to be appliedto any images, as desired.

FIG. 4 illustrates a process 400 for applying transformations to anoriginal image according to an embodiment of the invention. At block401, the social networking system 130 receives an original image. Atblock 402, the social networking system 130 receives transformationsassociated with the original image. The original image and thetransformations may be received simultaneously or at different times.The original image and the transformations may be received from the samepublishing client or from different publishing clients. At block 403,the social networking system 130 receives a request for the alteredimage from a consuming client. At block 404, the social networkingsystem 130 determines the capabilities of the consuming client. This maybe accomplished through the use of a client identifier, as described infurther detail below. At block 405, the social networking system createsa copy of the original image that is optimized for the consuming client.At block 406, the social networking system provides the original imagecopy and the transformations to the consuming client. The consumingclient applies the transformations to the original image copy.

According to one embodiment of the invention, the social networkingsystem 130 may determine whether the consuming client is a smartconsuming client or a simple consuming client. The social networkingsystem 130 may provide the original image copy and the transformationsto the consuming client or apply the transformations to the originalimage copy and provide the resulting altered image copy to the consumingclient based on whether the consuming client is a smart consuming clientor a simple consuming client, respectively. For example, the socialnetworking system 130 may determine that the consuming client is asimple consuming client because it is constrained or incapable ofapplying the selected transformations to the original image copy itself.This may be due to hardware limitations of the consuming client,functionality limitations of the application used to access the socialnetworking system 130 from the consuming client, or privacy settingsspecified by the user who created or uploaded the image. The socialnetworking system 130 may determine, at block 404 of the process 400,that the selected transformations cannot be applied to the originalimage copy on the consuming client. In this embodiment, the socialnetworking system 130 may itself apply the transformations to theoriginal image copy and provide the resulting altered image copy to theconsuming client. Thus, in an alternative implementation of the process400, if at block 404, the social networking system 130 determines thatthe consuming client is a simple consuming client, then the socialnetworking system 130 may apply the transformations to the originalimage copy itself. The social networking system 130 may then provide theresulting altered image copy to the simple consuming client. Accordingto an embodiment, the process 400 may be entirely or partially performedby the image processing module 146 or other modules of the socialnetworking system 130.

The process 400 may be implemented in various embodiments. The socialnetworking system 130 may be accessed from a variety of clients, each ofwhich may have its own unique set of capabilities, features, and photoediting tools that may involve their own image transformations. Inaddition, the operator of the social networking system 130 may provide anumber of different portals and applications that may have varyingtransformation capabilities and profiles, ranging from a websiteaccessed from within a web browser to customized applications designedfor specific platforms or customized hardware with editing controls.Thus, the set of transformations available to users of the socialnetworking system 130 for editing their images may not be identicalacross photo editing tools associated with the various devices, portals,and applications used to access the social networking system 130.

For example, this may be the case if the implementation of atransformation within the social networking system 130 is modified. Inthis example, a user may access the social networking system 130 usingan out-of-date application that has not been updated to reflect the mostrecent set of transformations available within the social networkingsystem 130. The user may select transformations based on how they appearas applied to the original image on the publishing client, not based onhow they are actually implemented within the social networking system130. If the user selects a transformation on the publishing client whoseimplementation within the social networking system 130 has since beenchanged, the social networking system 130 may apply the newer version ofthe transformation instead of the version selected by the user on thepublishing client, potentially resulting in a modification to theoriginal image that the user did not intend.

According to one embodiment of the invention, this concern may beaddressed by providing a client identifier that uniquely identifies theclient on which the user is editing the image. The client identifier mayrefer to a device, an application, a portal, a photo editing tool, orany hardware or software component used to access an image. A publishingclient identifier may be provided by the publishing client to the socialnetworking system 130 along with the transformation identifiers for thetransformations selected by the user, such as a character string or anyother suitable type of identifier. According to one embodiment, thesocial networking system 130 may maintain a record of the variouspublishing client identifiers and the versions of each transformationthat they correspond to within a storage module of the social networkingsystem 130. Upon receiving the publishing client identifier and thetransformation identifiers, the social networking system 130 may accessthe record and use the publishing client identifier and thetransformation identifiers to determine the version of eachtransformation that the user selected on the publishing client.

According to one embodiment, a client identifier may be used not only toensure that the correct version of the selected transformation isapplied, but also to optimize the altered image for the consumingclient. In addition to the publishing client providing a publishingclient identifier, the consuming client may also provide a consumingclient identifier to the social networking system 130 along with itsrequest for a copy of the altered image. Based on the consuming clientidentifier, the social networking system 130 may determine that certaintransformations need not be applied because the consuming client doesnot support them or is incapable of displaying them. For example, thesocial networking system 130 may be able to determine, using theconsuming client identifier, that the consuming client has a grayscaledisplay. Thus, the social networking system 130 may omit certaincolor-related transformations because the effect of thosetransformations would only be apparent on a color display. In addition,the social networking system 130 may create a grayscale version of theimage to provide to the consuming client, since grayscale imagestypically require fewer bytes to store and display. In effect, thesocial networking system “appends” a grayscale transformation to thelist of transformations specified by the user in order to spare theconsuming client the computing costs of having to convert a color imageto grayscale. In an embodiment, the social networking system 130 maydetermine that certain transformations are too computationally demandingfor a particular consuming client to perform or display, and the socialnetworking system 130 may thus substitute versions of the selectedtransformations that produce an image less demanding of computingresources on the consuming client.

FIG. 5 illustrates a process 500 for applying transformations to animage using transformation identifiers and client identifiers inaccordance with an embodiment of the invention. Initially, a user of apublishing client requests an original image stored within the socialnetworking system 130. The user may be requesting an original image thatwas previously uploaded to the social networking system 130 by him oranother user and made public by that user. Alternatively, the requestmay be generated automatically upon the user accessing an uploadinterface on the publishing client that displays a copy of the originalimage after the user has uploaded it. The user may request the originalimage through an interface of the social networking system 130 viewedwithin a web browser or an application customized for the socialnetworking system 130 and the publishing client. The user receives acopy of the original image from the social networking system 130 on thepublishing client and accesses a photo editing interface of a photoediting tool to modify the image. Within the photo editing interface,the user selects at least one transformation to be applied to theoriginal image and selects an option to save the original image. Atblock 501, the social networking system 130 receives transformationidentifiers associated with the original image from the publishingclient. The transformation identifiers may be expressed in the form of atransformation character string. The transformation character string mayidentify the transformations selected by the user in the form of acharacter or set of characters corresponding to each transformation andthe parameters, if any, that accompany it.

At block 502, the social networking system 130 parses and tokenizes thetransformation identifiers and a publishing client identifier. If thetransformation identifiers are expressed as a transformation characterstring, the social networking system 130 may parse the string accordingto a predetermined convention or according to an internal or externalspecification. The social networking system 130 may additionallyidentify the parameters, if any, that accompany the transformationidentifiers. At block 503, the social networking system 130 uses thetransformation identifiers and the publishing client identifier todetermine precisely which transformations the user has selected. Thepublishing client identifier may be used to determine which version of aparticular transformation was available on the application, platform, ordevice so that the proper version may be applied to the original imagewhen it is requested. At block 504, the social networking system 130stores the identified transformations and associates them with theoriginal image.

At block 505, the social networking system 130 receives a request forthe altered image from a consuming client. The request may include aconsuming client identifier. At block 506, the social networking system130 determines, using the stored transformations and the capabilities ofthe consuming client, which transformations to apply to the originalimage. The capabilities of the consuming client may correspond to thecapabilities of the device, portal, or application used to access thesocial networking system 130. The social networking system 130 may usethe consuming client identifier to determine the capabilities. Thesocial networking system 130 may identify the capabilities so that, forexample, only those transformations whose effect will be apparent on theconsuming client may be applied. At block 507, the social networkingsystem 130 creates a copy of the original image that is optimized forthe consuming client. At block 508, the social networking system 130 mayprovide the original image copy and an indication of the transformationsto the consuming client, which may apply the transformations to theoriginal image copy. Alternatively, if the consuming client is a simpleconsuming client, the social networking system may apply thetransformations determined in block 506 to the original image copy andprovide the altered image to the simple consuming client. According toan embodiment, the process 500 may be entirely or partially performed bythe image processing module 146 or other modules of the socialnetworking system 130.

The process 500 may require the social networking system 130 to keeptrack of all of various devices, platforms, applications, and photoediting tools used to select image transformations. This may potentiallybe cumbersome and difficult, particularly since many devices, platforms,and applications may be provided by third parties without the directknowledge or participation of the operator of the social networkingsystem 130. According to one embodiment of the invention, thislimitation may be addressed by providing a version number along witheach character or set of characters that identifies a transformation. Inthis embodiment, a transformation identifier may be expressed as acharacter or set of characters that identifies the transformation, theparameters of the transformation, and a character or set of charactersthat identifies the version of the transformation. The social networkingsystem 130 may receive this transformation identifier from thepublishing client and identify which version of the transformation touse without having to determine it from a publishing client identifier.This embodiment frees the social networking system 130 from the need tocontinuously track each device, platform, application, and photo editingtool that may be used to select image transformations and determinewhich version of each transformation it uses.

Although providing version numbers with each transformation may decreasethe amount of data that the social networking system 130 must store andmaintain, it may still result in inefficiencies. In order to interpretthe version numbers, the social networking system 130 may need tocontinuously track every version of every transformation everimplemented on an application, platform, device, or photo editing toolused to select image transformations.

According to one embodiment of the invention, the amount of data storedor tracked within the social networking system 130 corresponding totransformations can be further minimized through the use of a hashfunction. A hash function maps potentially large data sets to smallervalues, possibly of fixed length. In this embodiment, the transformationcharacter string provided by the publishing client to the socialnetworking system 130 may be processed using a hash function, resultingin a smaller string of values, i.e., a hash, that may be stored andassociated with the original image. When the altered image is requestedby a consuming client, the hash may be translated back to thetransformation character string using the hash function and provided tothe consuming client.

This embodiment may be particularly useful for transformations thatcomprise many operations. For example, a particular transformationinvolving several distinct operations may be expressed as a singlecommand in a photo editing interface of a photo editing tool on thepublishing client. When the user selects this transformation, thepublishing client may concatenate identifiers corresponding to each ofthe operations included in the transformation instead of providing asingle identifier for the transformation as a whole. Because theresulting transformation character string may be lengthy, the socialnetworking system 130 may reduce the amount of data it needs to store bymapping the transformation character string to a hash of fixed length.If the social networking system 130 has, for example, hundreds ofmillions of users, even small savings in data storage per user mayresult in significant savings in the aggregate. This embodiment alsofacilitates predictability in data storage allocation. If the hash is offixed length, each hash may comprise a roughly equivalent amount ofdata, which allows the operator of the social networking system 130flexibility in designing scalable data systems. Moreover, the resultingtransformation character strings may be identical across differentphotos, across different users who use the same editing tool or acrossdifferent tools based on a shared open source editing core. Identicalstrings may be represented by the same hash.

FIG. 6 illustrates a process 600 for mapping transformations to a hashin accordance with an embodiment of the invention. Initially, a user ofa publishing client requests an original image stored within the socialnetworking system 130. The user may be requesting an original image thatwas previously uploaded to the social networking system 130 by him oranother user and made public by the user. Alternatively, the request maybe generated automatically upon the user accessing an upload interfaceon the publishing client that displays a copy of the original imageafter the user has uploaded it. The user may request the original imagethrough an interface of the social networking system 130 viewed within aweb browser or an application customized for the social networkingsystem 130 and the publishing client. The user receives a copy of theoriginal image from the social networking system 130 on the publishingclient and accesses a photo editing interface to modify the image.Within the photo editing interface, the user selects at least onetransformation to be applied to the original image and selects an optionto save the original image. At block 601, the social networking system130 receives a transformation character string associated with theoriginal image from a publishing client. The transformation characterstring may express the transformations selected by the user in the formof a character or set of characters corresponding to each transformationand the parameters, if any, that accompany it. A transformation thatincludes multiple operations may be expressed as a concatenated stringwith characters corresponding to all included operations rather than asa single character or set of characters corresponding to thetransformation as a whole.

At block 602, the social networking system 130 maps the transformationcharacter string to a hash using a hash function. The hash function maybe a global hash function used by the social networking system 130 forevery transformation character string it receives. Alternatively, thehash function may be unique to a particular image, a block of images, adevice, a platform, an application, or a particular type of publishingclient. Any technique for determining a hash function may be used. Atblock 603, the social networking system 130 stores the hash andassociates it with the original image. In an embodiment, the socialnetworking system 130 may also store the transformation characterstring. At block 604, the social networking system 130 receives arequest for the altered image from a consuming client. The consumingclient may be the same device as the publishing client. Alternatively,the consuming client may be a different device from the publishingclient. At block 605, the social networking system 130 uses the hashfunction to derive the transformation character string from the hash. Atblock 606, the social networking system 130 parses the transformationcharacter string. The social networking system 130 may parse the stringaccording to a predetermined convention or according to an internal orexternal specification. By parsing the transformation character string,the social networking system 130 may tokenize or otherwise discern thetransformation identifiers contained in the transformation characterstring. At block 607, the social networking system 130 creates a copy ofthe original image that is optimized for the consuming client. At block608, the social networking system 130 applies transformationscorresponding to the transformation identifiers included in the stringto the copy of the original image. At block 609, the social networkingsystem 130 provides the altered image copy to the consuming client.Alternatively, if the consuming client is a smart consuming client, thenat block 608, the social networking system 130 provides the originalimage copy and the transformations to the smart consuming client and thesmart consuming client applies the transformations to the original imagecopy. According to an embodiment, the process 600 may be entirely orpartially performed by the image processing module 146 or other modulesof the social networking system 130.

In an embodiment, the social networking system 130 may store both thehash as well as the tokenized form of the string calculated in block603. This may require some additional storage, but it may save the CPUcost of parsing the same string repeatedly, which in turn may result inboth server-side power savings and faster execution. It may alsofacilitate detection of syntax errors in the provided strings, and allowfor rejection of malformed strings without the need to store them in thehash table.

According to one embodiment of the invention, some transformations mayproduce effects that involve creating random noise within an image. Forexample, the social networking system 130 may provide a transformationthat gives an image a grainy appearance to simulate the look of anold-fashioned photograph. These transformations may rely on randomnumber generators for the placement of artifacts or other elementswithin the image. The random number generator may output a sequence ofrandom values that affect how artifacts or other elements are placed orappear within the image. A notable consequence of this functionality isthat a transformation that relies on a random number generator mayproduce a different effect each time it is applied. Thus, an image towhich such a filter has been applied may look different each time it isrequested.

According to one embodiment of the invention, this concern may beaddressed through the use of random number seeds. Many random numbergenerators accept a seed, i.e., an initial value that the random numbergenerator uses as a basis to generate subsequent values. A random numbergenerator seeded with a particular value may always generate the samesequence of subsequent values. According to one embodiment, if a userselects a transformation that uses a random number generator, thepublishing client may initiate the random number generator, record theinitial value generated by the random number generator as a seed, andprovide the seed with the transformation identifiers to the socialnetworking system 130. The seed may be provided as a parameter with atransformation identifier. The social networking system 130 may storethe seed along with the transformation identifiers associated with theoriginal image. When the altered image is requested, the random numbergenerator may be initiated, either by the social networking system 130or by the consuming client, with the stored seed such that it outputsthe same sequence of values as when the transformation was first appliedto the original image.

According to one embodiment of the invention, expressing imagetransformations as a character string or other human readable form mayfacilitate social sharing of transformation sets among users of thesocial networking system 130. A user may conceive a sequence oftransformations that produce a desirable effect on an image to whichthey are applied. For example, a user may discover a sequence oftransformations that sharpens blurry images or otherwise achieves anaesthetically desirable visual effect. The user may wish to make thisset of transformations available for future use on other images by himor by his friends. According to one embodiment, a user may save a set oftransformations applied to an image separately from the image itself. Inthis embodiment, the user may select an option within a photo editinginterface that saves the sequence of transformations for laterapplication to other images. The user may give the sequence oftransformations a unique name and choose to make it available to hisfriends or other users of the social networking system 130. According toanother embodiment, the user may publish the sequence of transformationson his profile, which may cause it to appear in the news feeds of hisfriends. The user's friends may access the sequence of transformationsand apply them to their own images. According to yet another embodiment,the social networking system 130 may maintain a marketplace where these“custom” transformations are offered for free or for sale to otherusers.

According to one embodiment, the user may apply differenttransformations to the same image, producing a family of altered imagesderived from the same original. For example, a transformation may be atext balloon annotation, the image may be a celebrity photo, anddifferent altered images may depict the celebrity expressing differentthoughts in thought balloons (e.g., “I am bored today”, or “Zzzz . . .”). A single user may create multiple such alterations or differentusers may each create one or more alterations of a publicly sharedoriginal image.

Hardware Implementation

The foregoing processes and features can be implemented by a widevariety of machine and computer system architectures and in a widevariety of network and computing environments. FIG. 7 illustrates anexample of a computer system 700 that may be used to implement one ormore of the computing devices identified above. The computer system 700includes sets of instructions for causing the computer system 700 toperform the processes and features discussed herein. The computer system700 may be connected (e.g., networked) to other machines. In a networkeddeployment, the computer system 700 may operate in the capacity of aserver machine or a client machine in a client-server networkenvironment, or as a peer machine in a peer-to-peer (or distributed)network environment. In an embodiment of the invention, the computersystem 700 may be the social networking system 130, the user device 110,and the external system 120, or a component thereof. In an embodiment ofthe invention, the computer system 700 may be one server among many thatconstitutes all or part of the social networking system 130.

The computer system 700 includes a processor 702, a cache 704, and oneor more executable modules and drivers, stored on a computer-readablemedium, directed to the processes and features described herein.Additionally, the computer system 700 includes a high performanceinput/output (I/O) bus 706 and a standard I/O bus 708. A host bridge 710couples processor 702 to high performance I/O bus 706, whereas I/O busbridge 712 couples the two buses 706 and 708 to each other. A systemmemory 714 and one or more network interfaces 716 couple to highperformance I/O bus 706. The computer system 700 may further includevideo memory and a display device coupled to the video memory (notshown). Mass storage 718 and I/O ports 720 couple to the standard I/Obus 708. The computer system 700 may optionally include a keyboard andpointing device, a display device, or other input/output devices (notshown) coupled to the standard I/O bus 708. Collectively, these elementsare intended to represent a broad category of computer hardware systems,including but not limited to computer systems based on thex86-compatible processors manufactured by Intel Corporation of SantaClara, Calif., and the x86-compatible processors manufactured byAdvanced Micro Devices (AMD), Inc., of Sunnyvale, Calif., as well as anyother suitable processor.

An operating system manages and controls the operation of the computersystem 700, including the input and output of data to and from softwareapplications (not shown). The operating system provides an interfacebetween the software applications being executed on the system and thehardware components of the system. Any suitable operating system may beused, such as the LINUX Operating System, the Apple Macintosh OperatingSystem, available from Apple Computer Inc. of Cupertino, Calif., UNIXoperating systems, Microsoft® Windows® operating systems, BSD operatingsystems, and the like. Other implementations are possible.

The elements of the computer system 700 are described in greater detailbelow. In particular, the network interface 716 provides communicationbetween the computer system 700 and any of a wide range of networks,such as an Ethernet (e.g., IEEE 802.3) network, a backplane, etc. Themass storage 718 provides permanent storage for the data and programminginstructions to perform the above-described processes and featuresimplemented by the respective computing systems identified above,whereas the system memory 714 (e.g., DRAM) provides temporary storagefor the data and programming instructions when executed by the processor702. The I/O ports 720 may be one or more serial and/or parallelcommunication ports that provide communication between additionalperipheral devices, which may be coupled to the computer system 700.

The computer system 700 may include a variety of system architectures,and various components of the computer system 700 may be rearranged. Forexample, the cache 704 may be on-chip with processor 702. Alternatively,the cache 704 and the processor 702 may be packed together as a“processor module”, with processor 702 being referred to as the“processor core”. Furthermore, certain embodiments of the invention mayneither require nor include all of the above components. For example,peripheral devices coupled to the standard I/O bus 708 may couple to thehigh performance I/O bus 706. In addition, in some embodiments, only asingle bus may exist, with the components of the computer system 700being coupled to the single bus. Furthermore, the computer system 700may include additional components, such as additional processors,storage devices, or memories.

In general, the processes and features described herein may beimplemented as part of an operating system or a specific application,component, program, object, module, or series of instructions referredto as “programs”. For example, one or more programs may be used toexecute specific processes described herein. The programs typicallycomprise one or more instructions in various memory and storage devicesin the computer system 700 that, when read and executed by one or moreprocessors, cause the computer system 700 to perform operations toexecute the processes and features described herein. The processes andfeatures described herein may be implemented in software, firmware,hardware (e.g., an application specific integrated circuit), or anycombination thereof.

In one implementation, the processes and features described herein areimplemented as a series of executable modules run by the computer system700, individually or collectively in a distributed computingenvironment. The foregoing modules may be realized by hardware,executable modules stored on a computer-readable medium (ormachine-readable medium), or a combination of both. For example, themodules may comprise a plurality or series of instructions to beexecuted by a processor in a hardware system, such as the processor 702.Initially, the series of instructions may be stored on a storage device,such as the mass storage 718. However, the series of instructions can bestored on any suitable computer readable storage medium. Furthermore,the series of instructions need not be stored locally, and could bereceived from a remote storage device, such as a server on a network,via the network interface 716. The instructions are copied from thestorage device, such as the mass storage 718, into the system memory 714and then accessed and executed by the processor 702.

Examples of computer-readable media include, but are not limited to,recordable type media such as volatile and non-volatile memory devices;solid state memories; floppy and other removable disks; hard diskdrives; magnetic media; optical disks (e.g., Compact Disk Read-OnlyMemory (CD ROMS), Digital Versatile Disks (DVDs)); other similarnon-transitory (or transitory), tangible (or non-tangible) storagemedium; or any type of medium suitable for storing, encoding, orcarrying a series of instructions for execution by the computer system700 to perform any one or more of the processes and features describedherein.

For purposes of explanation, numerous specific details are set forth inorder to provide a thorough understanding of the description. It will beapparent, however, to one skilled in the art that embodiments of thedisclosure can be practiced without these specific details. In someinstances, modules, structures, processes, features, and devices areshown in block diagram form in order to avoid obscuring the description.In other instances, functional block diagrams and flow diagrams areshown to represent data and logic flows. The components of blockdiagrams and flow diagrams (e.g., modules, blocks, structures, devices,features, etc.) may be variously combined, separated, removed,reordered, and replaced in a manner other than as expressly describedand depicted herein.

Reference in this specification to “one embodiment”, “an embodiment”,“other embodiments”, “one series of embodiments”, or the like means thata particular feature, design, structure, or characteristic described inconnection with the embodiment is included in at least one embodiment ofthe disclosure. The appearances of, for example, the phrase “in oneembodiment” or “in an embodiment” in various places in the specificationare not necessarily all referring to the same embodiment, nor areseparate or alternative embodiments mutually exclusive of otherembodiments. Moreover, whether or not there is express reference to an“embodiment” or the like, various features are described, which may bevariously combined and included in some embodiments, but also variouslyomitted in other embodiments. Similarly, various features are describedthat may be preferences or requirements for some embodiments, but notother embodiments.

The language used herein has been principally selected for readabilityand instructional purposes, and it may not have been selected todelineate or circumscribe the inventive subject matter. It is thereforeintended that the scope of the invention be limited not by this detaileddescription, but rather by any claims that issue on an application basedhereon. Accordingly, the disclosure of the embodiments of the inventionis intended to be illustrative, but not limiting, of the scope of theinvention, which is set forth in the following claims.

1. A method comprising: by one or more computing servers of asocial-networking system, receiving, from a publishing client device ofa first user, at least one transformation identifier associated with afirst image maintained by the social-networking system, wherein each ofthe transformation identifiers uniquely identifies a transformationselected by the first user at the publishing client device forapplication to the first image; by one or more computing servers of thesocial-networking system, receiving, from the publishing client device,one or more capabilities of the publishing client device; by one or morecomputing servers of the social-networking system, storing the at leastone transformation identifier and the one or more capabilities of thepublishing client device with the first image in a data store of thesocial-networking system; and by one or more computing servers of thesocial-networking system, determining a transformation version for eachselected transformation for application to the first image based on theat least one transformation identifier and the one or more capabilitiesof the publishing client device.
 2. The method of claim 1, furthercomprising: receiving a request for an altered image from a consumingclient device; determining one or more capabilities of the consumingclient device; and creating a first image copy based on the first imageand the one or more capabilities of the consuming client device, thefirst image copy being optimized to the one or more capabilities of theconsuming client device.
 3. The method of claim 2, wherein the consumingclient device is at least one of a smart consuming client device and asimple consuming client device.
 4. The method of claim 2, furthercomprising: applying the at least one transformation to the first imagecopy to create an altered image copy; and providing the altered imagecopy to the consuming client device.
 5. The method of claim 2, furthercomprising providing the first image copy and an indication of the atleast one selected transformation to the consuming client device.
 6. Themethod of claim 2, further comprising: determining at least onetransformation version for the consuming client device based on the atleast one selected transformation and the one or more capabilities ofthe consuming client device; creating an altered image copy by applyingthe at least one transformation version of the at least one selectedtransformation to the first image copy; and providing the altered imagecopy to the consuming client device.
 7. The method of claim 2, furthercomprising: determining at least one transformation version for theconsuming client device based on the at least one selectedtransformation and the one or more capabilities of the consuming clientdevice; and providing the first image copy and the at least onetransformation version for the consuming client device to the consumingclient device.
 8. The method of claim 2, further comprising receiving aconsuming client device identifier, and wherein determining the one ormore capabilities of the consuming client device is based on theconsuming client device identifier.
 9. The method of claim 2, whereindetermining a transformation version for each selected transformation isfurther based on the one or more capabilities of the consuming clientdevice.
 10. The method of claim 2, wherein the one or more capabilitiesof the consuming client device comprise one or more capabilities of anapplication running on the consuming client device, wherein a seconduser of the consuming client device accesses the social-networkingsystem via the application.
 11. The method of claim 2, wherein the oneor more capabilities of the consuming client device comprise one or moregraphics processing capabilities of the consuming client device.
 12. Themethod of claim 2, wherein the one or more capabilities of the consumingclient device comprise a display size of the consuming client device.13. The method of claim 1, wherein the at least one transformationidentifier may be used to apply the at least one selected transformationto a second image.
 14. The method of claim 13, wherein the first imageis associated with the first user of the social-networking system andthe second image is associated with a second user of thesocial-networking system.
 15. The method of claim 1, wherein the atleast one transformation identifier is provided by the first user of thesocial-networking system to a second user of the social-networkingsystem.
 16. The method of claim 1, wherein the one or more capabilitiesof the publishing client device comprise one or more capabilities of anapplication running on the publishing client device, wherein the firstuser accesses the social-networking system via the application.
 17. Themethod of claim 1, wherein the one or more capabilities of thepublishing client device comprise one or more graphics processingcapabilities of the publishing client device.
 18. The method of claim 1,wherein the one or more capabilities of the publishing client devicecomprise a display size of the publishing client device.
 19. One or morecomputer-readable non-transitory storage media embodying software thatis operable when executed to: receive, from a publishing client deviceof a first user, at least one transformation identifier associated witha first image maintained by the social-networking system, wherein eachof the transformation identifiers uniquely identifies a transformationselected by the first user at the publishing client device forapplication to the first image; receive, from the publishing clientdevice, one or more capabilities of the publishing client device; storethe at least one transformation identifier and the one or morecapabilities of the publishing client device with the first image in adata store of the social-networking system; and determine atransformation version for each selected transformation for applicationto the first image based on the at least one transformation identifierand the one or more capabilities of the publishing client device.
 20. Asystem comprising: one or more processors; and a memory coupled to theprocessors comprising instructions executable by the processors, theprocessors operable when executing the instructions to: receive, from apublishing client device of a first user, at least one transformationidentifier associated with a first image maintained by thesocial-networking system, wherein each of the transformation identifiersuniquely identifies a transformation selected by the first user at thepublishing client device for application to the first image; receive,from the publishing client device, one or more capabilities of thepublishing client device; store the at least one transformationidentifier and the one or more capabilities of the publishing clientdevice with the first image in a data store of the social-networkingsystem; and determine a transformation version for each selectedtransformation for application to the first image based on the at leastone transformation identifier and the one or more capabilities of thepublishing client device.